import java.util.*;


public class Solution2 {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     * 比较版本号
     * @param version1 string字符串 
     * @param version2 string字符串 
     * @return int整型
     */
    public int compare (String version1, String version2) {
        // write code here
        String[] s1 = version1.split("\\.");
        String[] s2 = version2.split("\\.");
        int l = s1.length < s2.length?s1.length:s2.length;
        int i = 0;
        while(i < l){
            Integer str1 = Integer.parseInt(s1[i]);
            Integer str2 = Integer.parseInt(s2[i]);
            if(str1 > str2){
                return 1;
            } else if(str2 > str1) {
                return -1;
            }
            i++;
        }
        String[] s = s1.length > s2.length?s1 : s2;
        while(i < s.length){
            Integer str = Integer.parseInt(s[i]);
            if(str > 0){
                return s1.length > s2.length?1:-1;
            }
            i++;
        }
        return 0;
    }
}